#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n,a[N],ans,sum[N];
bool vis1[N],vis2[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    if(n<=31){
        for(int i=1;i<=n;i++)   cin>>a[i];
        sort(a+1,a+n+1);
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                if(a[i]<a[j]&&!vis1[j]&&!vis2[j]&&!vis2[i]){
                    ans--;
                    vis1[j]=true;
                    vis2[i]=true;
                    break;
                }
            }
        }
        cout<<ans;
    }
    else{
        for(int i=1;i<=n;i++){
            cin>>a[i];
            sum[a[i]]++;
        }
        ans=max(sum[1],sum[2]);
        cout<<ans;
    }
    fclose(stdin);
    fclose(stdout);
    return 0;
}
